Expand description

twilight-http-ratelimiting

Ratelimiting functionality for HTTP requests.

Discord ratelimits requests to the HTTP API both globally and per-route. For more information on the specifics, please take a look at Discord’s documentation.

This crate provides a common Ratelimiter trait that all ratelimiter implementations need to implement.

It also ships a default implementation, InMemoryRatelimiter, that manages the bucket states in memory.

Re-exports

Modules

  • Parse typed headers from a response.
  • In-memory based default Ratelimiter implementation used in twilight-http.
  • Request parameters for ratelimiting.
  • Flow for managing ratelimit tickets.

Structs

  • A bucket containing ratelimiting information for a Path.

Traits

  • An implementation of a ratelimiter for the Discord REST API.

Type Aliases